# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_pkgname=pax
pkgname=${_pkgname}-git
pkgver=20161104.2
pkgrel=1
pkgdesc="POSIX standard archive tool"
arch=('i686' 'x86_64')
groups=('base')
depends=('msys2-runtime')
makedepends=('git')
url="https://www.openbsd.org/cgi-bin/cvsweb/src/bin/pax/"
license=('BSD')
provides=("${_pkgname}")
conflicts=("${_pkgname}")
source=("${_pkgname}"::"git://anonscm.debian.org/collab-maint/pax.git"
        Makefile.msys)
sha256sums=('SKIP'
            'c4864ee6738dde01073bb690fea997153ce22116cc80930032352d14749a9303')

pkgver() {
  cd ${srcdir}/${_pkgname}
  git describe --tags | sed -e 's|-|.|g' -e 's|pax.||g'
}

prepare() {
  rm -f ${srcdir}/${_pkgname}/Makefile.msys
  cp ${srcdir}/Makefile.msys ${srcdir}/${_pkgname}
}

build() {
  cd ${srcdir}/${_pkgname}
  make -f Makefile.msys
}

package() {
  cd ${srcdir}/${_pkgname}
  make -f Makefile.msys DESTDIR=${pkgdir} install
}
